#include "lcm_info.h"
#include "Levetop_uart.h"
#include "bsp.h"
#include "printf.h"
#include <string.h>

const char product_name[64] = LCM_NAME;
const char fw_version[64] = VERSION(V_MAJOR);

void lcm_info(void)
{
	char pn[64];
	char pv[64];
	int pr;

	pr = levetop_pack((unsigned char *)pn, 0xc1, 0x00, (char *)product_name, strlen(product_name));
	if (pr < 0) {
		printf("error\r\n");
	}
	bsp_uart_send(pn, pr);

	pr = levetop_pack((unsigned char *)pv, 0xc1, 0x01, (char *)fw_version, strlen(fw_version));
	if (pr < 0) {
		printf("error\r\n");
	}
	bsp_uart_send(pv, pr);
}
